package com.dhl.demo.controller;

import com.dhl.demo.domain.RedisLock;
import com.dhl.demo.service.IRedisLockService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author danghailiang
 * @date 2023年03月14日 20:48
 */
@RestController
@RequestMapping("/demo/delay")
public class RedisDelayDelController {

    /**
     * 服务
     */
    @Resource
    private IRedisLockService redisLockService;

    @GetMapping("/insert")
    public void insert(){
        redisLockService.insert();
    }
    @GetMapping("/findAll")
    public int findAll(){
        return redisLockService.findAll().size();
    }

}
